package com.qf.service.impl;

import com.qf.entity.User;
import com.qf.mapper.UserMapper;
import com.qf.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper mapper;
    @Override
    public User findByName(String name) {
        return mapper.findByName(name);
    }

    @Override
    public int addUser(String username, String password,String key) {
        try {
            int i = mapper.addUser(username, password,key);
            return i;
        }catch (Exception e){
            e.printStackTrace();
            return -1;
        }
    }
}
